<%@ page language="java" pageEncoding="utf-8"%>
<%@ include file="../includes/importer.jsp"%>
<!doctype html>
<html>

<head>
<ht:head />
<script type="text/javascript">
	$("input[name='acId']").change(function(){
		$("input[name='acId']").attr("checked",false);
		$(this).attr("checked",true);
	});
	
</script>
</head>
<body>

	<br />
	<div id="search-menu">
		<ul>
			<ht:menu-btn type="search" />
		</ul>
		<br style="clear: left" />
	</div>
	<div class="queryContainer">
		<form name="queryForm" id="queryForm" action="list" method="get">
			<table>
				<tr>
					<td width="100">活动名称：</td>
					<td width="150"><input type="text" name="name" value="${param.name}" class="txt" style="width: 150px" /></td>
					
					<td width="65">创建时间：</td> 	
					<td width="300">
	                    <input type="text" id="inputStartTimeS" name="inputStartTimeS" value="${param.inputStartTimeS}" class="txt Wdate"
	                           readOnly onfocus="WdatePicker({vel:'createTime',realDateFmt:'yyyyMMdd',maxDate:'#F{$dp.$D(\'inputEndTimeS\')||\'2020-10-01\'}'})" />
	                    <input type="hidden" name="createTime" id="createTime" value="${param.createTime}"/>
	                   	 至
	                    <input type="text" id="inputEndTimeS" name="inputEndTimeS" value="${param.inputEndTimeS}" class="txt Wdate"
	                           readOnly onfocus="WdatePicker({vel:'cerateTimeEnd',realDateFmt:'yyyyMMdd',minDate:'#F{$dp.$D(\'inputStartTimeS\')}',maxDate:'2020-10-01'})" />
	                    <input type="hidden" name="cerateEndTime" id="cerateEndTime" value="${param.cerateEndTime}" />
	                </td>
	                
				</tr>
				<tr>
				<td width="60">活动类型：</td>
					<td width="150">	
					<select name="type">
                   		<option value>--请选择--</option>
	                   	<c:forEach items="${typeMap }" var="typeMap">
	                   		<option value="${typeMap.key }" <c:if test="${param.type==typeMap.key }">selected</c:if>>${typeMap.value }</option>
	                   	</c:forEach>
	                   </select>
	                 </td>
	                <td colspan="4"><ct:btn type="search" /></td>
				</tr>
			</table>
		</form>
	</div>
	<div class="container">
		<br />
		<h3>活动列表</h3>
		<div class="mainbox">
			<c:if test="${not empty pageData}">

				<table class="datalist fixwidth">
					<tr>
						<th nowrap="nowrap" width="20"></th>
						<th nowrap="nowrap" width="120">活动名称</th>
						<th nowrap="nowrap" width="100">活动类型</th>
						<th nowrap="nowrap" width="130">创建时间</th>
						<th nowrap="nowrap" width="130">活动开始时间</th>
						<th nowrap="nowrap" width="130">活动结束时间</th>
					</tr>
				<c:forEach items="${pageData.data}" var="item">
						<tr>
							<td nowrap="nowrap">
							<input type="checkbox" name="acId" value="${item.id }">
							<input type="hidden" value="${item.name }">
							</td>
							<td nowrap="nowrap">${item.name}</td>
							<td nowrap="nowrap" class="ellipsis">${typeMap[item.type] }</td>
							<td nowrap="nowrap"><ct:time source="${item.createTime }"/></td>
							<td nowrap="nowrap"><ct:time source="${item.startTime }"/></td>
							<td nowrap="nowrap"><ct:time source="${item.endTime }"/></td>
						</tr>
				</c:forEach>
				</table>

				<ht:page pageData="${pageData}" />

			</c:if>
			<c:if test="${empty pageData.data}">
				<div class="note">
					<p class="i">目前没有相关记录!</p>
				</div>
			</c:if>
		</div>

	</div>

</body>
</html>